package com.itheima.day06_Exception;

public class Test {
    public static void main(String[] args) {
        Student s = new Student();

        try {
            s.setAge(18);
            s.setSex("男");
        } catch (AgeException e) {
            System.out.println("年龄异常");
        }catch (SexException e){
            System.out.println("性别异常");
        }
        s.setName("小明");
        System.out.println(s);
    }
}
